Skip to content

ci(release): build releases from pushed version tags - #2703

Draft
konradzapalowicz wants to merge 1 commit into
chainguard-dev:mainfrom
konradzapalowicz:konrad/clo-24-release-from-tags
Draft

konradzapalowicz wants to merge 1 commit into
chainguard-dev:mainfrom
konradzapalowicz:konrad/clo-24-release-from-tags

Conversation

@konradzapalowicz

Copy link
Copy Markdown
Contributor

Summary

The release workflow now builds and publishes a release when a vX.Y.Z tag is pushed, instead of running weekly and picking the next version itself. It no longer creates tags.

A tag push runs the workflow from the tagged commit, so a dispatch job re-runs it on main. Release files are therefore still signed as release.yaml@refs/heads/main. The release job refuses a tag that is not a version, already has a release (drafts included), or is not on main, then runs goreleaser as before. goreleaser creates the release itself, because the repo's releases are immutable. .goreleaser.yaml and the Makefile are unchanged.

To build a tag by hand, run the workflow on main with that tag. This is also the way to build a tag that was pushed on a commit without this workflow, or pushed together with more than three other tags. A draft left by a failed run must be deleted first.

What changed

v1.6.0 pushed by mono (octo-sts token)
   │ push: tags [v*]          workflow file read from the tagged commit
   ▼
job dispatch      actions: write
   gh workflow run release.yaml --ref main -f tag=v1.6.0
   │ workflow_dispatch        workflow file read from main
   ▼
job release       id-token + contents write, one run at a time per tag
   check: runs on main            → otherwise "Run this workflow on main…"
   check: tag is vX.Y.Z           → refuses rc tags and odd input
   check: no release, drafts too  → "delete the draft and run again"
   checkout refs/tags/v1.6.0 (full history)
   check: tag's commit is on main
   setup-go, cosign v2.6.1, goreleaser          (unchanged)
   make release   GORELEASER_CURRENT_TAG = GIT_VERSION = v1.6.0
      goreleaser: draft → build + sign → upload 27 files → publish
 on:
-  schedule: weekly cron
-  workflow_dispatch:
+  push: { tags: ['v*'] }
+  workflow_dispatch: { inputs: { tag } }
 jobs:
+  dispatch: ...                                  # new
   release:
-    change-detection script, github-tag-action, `if: need_release` gates
+    4 checks (main ref, tag format, no release, tag on main)
-    env TAG (never read by the Makefile)
+    env GORELEASER_CURRENT_TAG, GIT_VERSION

🤖 Generated with Claude Code

Releases are cut from vX.Y.Z tags that mono's publish pushes, instead of
a weekly job that picks the next version and tags it. A tag push re-runs
this workflow on main, so release artifacts are still signed as
release.yaml@refs/heads/main. The release job refuses a tag that is not
a version, already has a release (including a draft), or is not on main,
then runs goreleaser as before.

To build a tag by hand, run the workflow on main with that tag.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@konradzapalowicz
konradzapalowicz marked this pull request as draft November 27, 2026 18:09
@konradzapalowicz

Copy link
Copy Markdown
Contributor Author

Lets keep it draft until after right before importing apko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant